package com.kgc.sbt.provider;

import com.alibaba.dubbo.config.annotation.Service;
import com.kgc.sbt.api.SlideShowApi;
import com.kgc.sbt.domain.Slideshow;
import com.kgc.sbt.domain.SlideshowExample;
import com.kgc.sbt.mapper.SlideshowMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Created on 2021/6/23.
 * <p>
 * Author: a123
 * <p>
 * Description:
 */
@Service
public class SlideShowProvider implements SlideShowApi {

    @Autowired
    private SlideshowMapper slideshowMapper;

    @Override
    public List<Slideshow> selectSlideShow() {

        SlideshowExample slideshowExample = new SlideshowExample();

        slideshowExample.setOrderByClause("sort");

        return slideshowMapper.selectByExample(slideshowExample);
    }

    @Override
    public Slideshow selectById(Integer id) {

        return slideshowMapper.selectByPrimaryKey(id);
    }
}
